package com.itheima.test;

import java.util.Collection;

import javax.ws.rs.core.MediaType;

import org.apache.cxf.jaxrs.client.WebClient;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import com.opensymphony.xwork2.ActionContext;

import cn.itcast.crm.domain.Customer;
import cn.itcast.crm.service.base.ICustomerService;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration("file:src/main/resources/applicationContext.xml")
public class Model {
	@Autowired
	private ICustomerService customerService;
	@Test
	public void test1(){
		//System.out.println(customerService.findNoAssociationCustomer());
		
		
	}
	public static void main(String[] args) {
		Collection<? extends Customer> collection = WebClient.create("http://localhost:8088/crm_management/services/customerService/no").
		accept(MediaType.APPLICATION_JSON).getCollection(Customer.class);
		System.out.println(collection);
		ActionContext.getContext().getValueStack().push(collection);
	}

}
